package com.qf.web;

import com.qf.bean.Message;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 2019/11/18
 * Administrator
 * springmvc1118
 * 面向对象面向君  不负代码不负卿
 */
@Controller
public class AjaxController {


    @RequestMapping("/checkname")
    @ResponseBody  //告诉程序返回json格式
    public Message a1(String username){
        if(username.equals("admin")){
            return new Message("用户名已占用");
        }
        return new Message("用户名可用");
    }
}
